import type { FC } from 'react';
import { View, Text, TouchableOpacity } from 'react-native';
import { Avatar } from '@/components';
import { User } from '@/typings/user';
import FollowBtn from '@/components/PostItem/followBtn';
import styles from './styles';

type UserFollowProps = {
  user: User.UserInfo;
  followed?: boolean;
  onFollowedPress?: () => void;
}

const UserFollow: FC<UserFollowProps> = (props) => {
  const { user } = props;
  return (
    <View style={styles.wrapper}>
      <TouchableOpacity
        style={styles.user}
        activeOpacity={.8}
      >
        <Avatar
          size="small"
          url={user.avatar}
        />
        <Text
          numberOfLines={1}
          style={styles.userName}
        >
          {user.nickName}
        </Text>
      </TouchableOpacity>
      <FollowBtn
        {...props}
        ghost={false}
      />
    </View>
  );
}

export default UserFollow;